<?php echo $header; ?>
<div class="container make-bg">
<?php echo $content_top; ?>

      <div class="messages">
          <?php if ($success) { ?><div class="success"><?php echo $success; ?></div><?php } ?>
          <?php if ($error_warning) { ?><div class="warning"><?php echo $error_warning; ?></div><?php } ?>
      </div>
            <ul class="breadcrumb">
               <?php foreach ($breadcrumbs as $breadcrumb) { ?>
          <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
          <?php } ?>
            </ul>
            
        <div class="row">
            
      <div class="span9 post">
              <div class="row-fluid">
                <div class="span5">
                    <h2 class="widget-title"><span><?php echo $heading_title; ?></span></h2>
                    <div class="sidebar-line"><span></span></div>
                      <p><?php echo $text_help; ?></p>
                         <form action="<?php echo $login_action; ?>" method="post" enctype="multipart/form-data" class="signin-form">
                          <input class="input-block-level" name="email" placeholder="Enter your email address" id="inputEmail" type="text">
                          <input class="input-block-level" name="password" placeholder="Enter your password" id="inputPassword" type="password">
                          <label for="inputPassword">
                            <a href="<?php echo $forgotten; ?>"><?php echo $text_forgotten; ?></a>
                          </label>
                          <label class="checkbox"><input type="checkbox"><?php echo $text_remember; ?> </label>
                          <button class="btn btn-medium btn-general input-block-level" type="submit"><?php echo $button_login; ?></button>
                        </form>
              </div>
            <div class="span7">
                      <h2 class="widget-title"><span><?php echo $heading_title; ?></span></h2>
                      <div class="sidebar-line"><span></span></div>
                         <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
                            <label for="inputEmail"><span class="required">*</span> Your Personal Details</label>
                            <input class="input-block-level" name="firstname" value="<?php echo $firstname; ?>"  type="text" placeholder="* <?php echo $entry_firstname; ?>" id="inputname" />
                            <?php if ($error_firstname) { ?>
                            <span class="error"><?php echo $error_firstname; ?></span>
                            <?php } ?>
                            <input class="input-block-level" name="lastname" value="<?php echo $lastname; ?>" placeholder="* <?php echo $entry_lastname; ?>" type="text" id="inputlastname" />
                            <?php if ($error_lastname) { ?>
                            <span class="error"><?php echo $error_lastname; ?></span>
                            <?php } ?>
                            <input class="input-block-level" name="email" value="<?php echo $email; ?>" placeholder="* <?php echo $entry_email; ?>" type="text" id="inputemail" />
                            <?php if ($error_email) { ?>
                            <span class="error"><?php echo $error_email; ?></span>
                            <?php } ?>
                            <input class="input-block-level" name="telephone" value="<?php echo $telephone; ?>" placeholder="<?php echo $entry_telephone; ?>" type="text" id="inputphone" />
                             <?php if ($error_telephone) { ?>
                            <span class="error"><?php echo $error_telephone; ?></span>
                            <?php } ?>  

                            <label for="inputEmail"><span class="required">*</span> Shipping Address Details</label>
                            <input class="input-block-level" name="address_1" type="text" value="<?php echo $address_1; ?>" placeholder="* <?php echo $entry_address_1; ?>" id="inputaddress" />
                            <?php if ($error_address_1) { ?>
                            <span class="error"><?php echo $error_address_1; ?></span>
                            <?php } ?>

                            <input class="input-block-level" name="address_2" value="<?php echo $address_2; ?>" placeholder="<?php echo $entry_address_2; ?>" type="text" id="inputaddress1" />
                            <input class="input-block-level" name="city" value="<?php echo $city; ?>" placeholder="* <?php echo $entry_city; ?>" type="text" id="inputcity" />
                             <?php if ($error_city) { ?>
                            <span class="error"><?php echo $error_city; ?></span>
                            <?php } ?>
                            <input class="input-block-level" name="postcode" value="<?php echo $postcode; ?>" placeholder="* <?php echo $entry_postcode; ?>" type="text" id="inputcode" />
                            <?php if ($error_postcode) { ?>
                            <span class="error"><?php echo $error_postcode; ?></span>
                            <?php } ?>
                               <label for="inputEmail"><span class="required">*</span> <?php echo $entry_country; ?> / Region / State</label>
                              <select class="span5" name="country_id">
                              <option value=""><?php echo $text_select; ?></option>
                              <?php foreach ($countries as $country) { ?>
                              <?php if ($country['country_id'] == $country_id) { ?>
                              <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
                              <?php } else { ?>
                              <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
                              <?php } ?>
                              <?php } ?>
                            </select>
                            <?php if ($error_country) { ?>
                            <span class="error"><?php echo $error_country; ?></span>
                            <?php } ?>
                              
                             <select name="zone_id">
                              </select>
                              <?php if ($error_zone) { ?>
                              <span class="error"><?php echo $error_zone; ?></span>
                              <?php } ?></td>
                               <label for="inputEmail"><span class="required">*</span> <?php echo $entry_password; ?></label>
                            <input class="input-block-level" name="password" value="<?php echo $password; ?>" placeholder="* Enter your password" type="password" id="inputpassword" />
                            <?php if ($error_password) { ?>
                            <span class="error"><?php echo $error_password; ?></span>
                            <?php } ?>
                            <input class="input-block-level"  name="confirm" value="<?php echo $confirm; ?>" placeholder="* Enter your password again" type="password" id="inputpassword" />
                             <?php if ($error_confirm) { ?>
                            <span class="error"><?php echo $error_confirm; ?></span>
                            <?php } ?>
                                
                              <label for="inputEmail"><span class="required"></span><?php echo $text_newsletter; ?></label>                          
                              <?php if ($newsletter) { ?>
                              <input type="radio" name="newsletter" value="1" checked="checked" />
                              <?php echo $text_yes; ?>
                              <input type="radio" name="newsletter" value="0" />
                              <?php echo $text_no; ?>
                              <?php } else { ?>
                              <input type="radio" name="newsletter" value="1" />
                              <?php echo $text_yes; ?>
                              <input type="radio" name="newsletter" value="0" checked="checked" />
                              <?php echo $text_no; ?>
                              <?php } ?>
                                  <?php if ($text_agree) { ?>
                              <div class="buttons">
                                <div>
                                  <button type="submit" class="btn btn-medium btn-general input-block-level"><?php echo $button_continue; ?></button>
                                  <?php if ($agree) { ?>
                                  <input type="checkbox" name="agree" value="1" checked="checked" />
                                  <?php } else { ?>
                                  <input type="checkbox" name="agree" value="1" />
                                  <?php } ?>
                                  <?php echo $text_agree; ?>
                                </div>
                              </div>
                              <?php } else { ?>
                              <div class="buttons">
                                <div>
                                  <button type="submit" class="btn btn-medium btn-general input-block-level"><?php echo $button_continue; ?></button>
                                </div>
                              </div>
                              <?php } ?>
                          </form>
                          <style type="text/css">
                          .sidebar-line + form input[type="radio"],.sidebar-line   + form input[type="checkbox"]{
                            margin: 0;
                          }
                          </style>
            </div>
                </div>
      </div>
            
      <div class="span3 sidebar">
      <div class="widget">
        <h2 class="widget-title"><span>User Pages</span></h2>
        <div class="sidebar-line"><span></span></div>
          <ul class="nav nav-list bs-docs-sidenav">
                         <li ><a href="<?php echo $login; ?>"><?php echo $text_login_page ?></a></li>
                        <li class="active"><a href="<?php echo $register; ?>"><?php echo $text_register_page ?></a></li>
                        <li><a href="<?php echo $wishlist; ?>"><?php echo $text_wishlist_page; ?></a></li>
                        <li><a href="<?php echo $account; ?>"><?php echo $text_account_page ?></a></li>
                        <li><a href="<?php echo $cart; ?>"><?php echo $text_cart_page ?></a></li>
                        <li><a href="<?php echo $checkout; ?>"><?php echo $text_checkout_page ?></a></li>
                       <!-- <li><a href="<?php echo $ticket; ?>"><?php echo $text_ticket_page ?></a></li>-->
        </ul>
                </div>
                
                 <?php echo $column_right; ?>
      </div>
    </div>
<script type="text/javascript"><!--
$('input[name=\'customer_group_id\']:checked').live('change', function() {
  var customer_group = [];
  
<?php foreach ($customer_groups as $customer_group) { ?>
  customer_group[<?php echo $customer_group['customer_group_id']; ?>] = [];
  customer_group[<?php echo $customer_group['customer_group_id']; ?>]['company_id_display'] = '<?php echo $customer_group['company_id_display']; ?>';
  customer_group[<?php echo $customer_group['customer_group_id']; ?>]['company_id_required'] = '<?php echo $customer_group['company_id_required']; ?>';
  customer_group[<?php echo $customer_group['customer_group_id']; ?>]['tax_id_display'] = '<?php echo $customer_group['tax_id_display']; ?>';
  customer_group[<?php echo $customer_group['customer_group_id']; ?>]['tax_id_required'] = '<?php echo $customer_group['tax_id_required']; ?>';
<?php } ?>  

  if (customer_group[this.value]) {
    if (customer_group[this.value]['company_id_display'] == '1') {
      $('#company-id-display').show();
    } else {
      $('#company-id-display').hide();
    }
    
    if (customer_group[this.value]['company_id_required'] == '1') {
      $('#company-id-required').show();
    } else {
      $('#company-id-required').hide();
    }
    
    if (customer_group[this.value]['tax_id_display'] == '1') {
      $('#tax-id-display').show();
    } else {
      $('#tax-id-display').hide();
    }
    
    if (customer_group[this.value]['tax_id_required'] == '1') {
      $('#tax-id-required').show();
    } else {
      $('#tax-id-required').hide();
    } 
  }
});

$('input[name=\'customer_group_id\']:checked').trigger('change');
//--></script> 
<script type="text/javascript"><!--
$('select[name=\'country_id\']').bind('change', function() {
  $.ajax({
    url: 'index.php?route=account/register/country&country_id=' + this.value,
    dataType: 'json',
    beforeSend: function() {
      $('select[name=\'country_id\']').after('<span class="wait">&nbsp;<img src="catalog/view/theme/bistro/image/loading.gif" alt="" /></span>');
    },
    complete: function() {
      $('.wait').remove();
    },      
    success: function(json) {
      if (json['postcode_required'] == '1') {
        $('#postcode-required').show();
      } else {
        $('#postcode-required').hide();
      }
      
      html = '<option value=""><?php echo $text_select; ?></option>';
      
      if (json['zone'] != '') {
        for (i = 0; i < json['zone'].length; i++) {
              html += '<option value="' + json['zone'][i]['zone_id'] + '"';
            
          if (json['zone'][i]['zone_id'] == '<?php echo $zone_id; ?>') {
                html += ' selected="selected"';
            }
  
            html += '>' + json['zone'][i]['name'] + '</option>';
        }
      } else {
        html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';
      }
      
      $('select[name=\'zone_id\']').html(html);
    },
    error: function(xhr, ajaxOptions, thrownError) {
      alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    }
  });
});

$('select[name=\'country_id\']').trigger('change');
//--></script> 
<script type="text/javascript"><!--
$(document).ready(function() {
  $('.colorbox').colorbox({
    width: 640,
    height: 480
  });
});
//--></script> 
 <?php echo $content_bottom; ?>
</div>
<?php echo $footer; ?>  






